Skip to content

Conversation

@petermcneeleychromium
Copy link

The Result of a bitcast via 'asuint' should be unsigned.

Code that will (incorrectly) generate an assert.

RWByteAddressBuffer v : register(u0);
void foo() {
  int v_1 = int(0);
  v.InterlockedAdd(int(16u), asint((asuint(int(0)) - asuint(int(123)))), v_1);
  int x = v_1;
}

Failing code (6199) '/dxc/tools/clang/lib/AST/ExprConstant.cpp'

  assert(SI.isSigned() == E->getType()->isSignedIntegerOrEnumerationType() &&
           "Invalid evaluation result.");

@dneto0 dneto0 self-requested a review July 4, 2025 14:32
@dneto0 dneto0 requested a review from s-perron July 4, 2025 14:47
Copy link
Collaborator

@s-perron s-perron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-perron s-perron requested a review from llvm-beanz July 4, 2025 18:39
@s-perron
Copy link
Collaborator

s-perron commented Jul 4, 2025

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@s-perron s-perron requested a review from damyanp July 4, 2025 18:40
@s-perron
Copy link
Collaborator

Ping @llvm-beanz @damyanp

@petermcneeleychromium
Copy link
Author

ping on this change. It is quite small change.

@damyanp
Copy link
Member

damyanp commented Sep 3, 2025

I'll have to defer details of a review to someone more familiar with this code, but as s-perron mentioned above, there should be an associated test to go along with this.

@petermcneeleychromium
Copy link
Author

Looks like jim actually fixed this
https://github.com/microsoft/DirectXShaderCompiler/pull/7396/files

@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Oct 22, 2025
@petermcneeleychromium petermcneeleychromium deleted the asuint_bitcast_fix_signed_minor branch October 23, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants